<template>
  <div>
     <img style="width:100%" :src="data.banner" alt="">
     <van-notice-bar 
     background='rgb(236 249 255)' 
     left-icon="volume-o" 
     color='yellowgreen'
     scrollable 
     text="优惠大酬宾，买到就是赚到！！！" />
     <van-divider
      :style="{ color: 'yellowgreen', borderColor: 'yellowgreen', padding: '0 16px' }"
    >
      精选商品
    </van-divider>

    <div class="box">
        <div class="box-it" @click="$router.push('/det?tid='+v.tid)" v-for="v in data.subsel" :key="v.tid">
            <van-card
              :price="v.price+'.00'"
              :desc="v.tintro"
              :title="v.tname"
              :thumb="v.timg"
            />
        </div>
    </div>
  </div>
</template>
<script>
import {Home} from "@/utils/api"
export default {
  data() {
    return {
       data:{}
    }
  },
  mounted(){
      this.getDate()
  },
  computed:{

  },
  methods:{
     getDate(){// 获取数据
        Home()
        .then(res=>{
          console.log(res);
          if(res.code==200){
            this.data=res.data
          }
        })
     }
  },
}
</script>
<style scoped>
   .box{
      padding: 5px;
      display: flex;
      flex-wrap: wrap;
      justify-content: space-between;
   }
   .box-it{
      width: 49%;
      /* height: 200px; */
      margin-top: 10px;
      /* background: pink; */
      border-radius: 5px;
      overflow: hidden;
   }
</style>
